package goxpath

Import Path
	github.com/ChrisTrenkamp/goxpath (on go.dev)

Dependency Relation
	imports 7 packages, and imported by 2 packages

Involved Source Files goxpath.go marshal.go
Package-Level Type Names (total 3)
/* sort by: | */
FuncOpts is a function wrapper for Opts. func ParseExec(xpstr string, t tree.Node, opts ...FuncOpts) (tree.Result, error) func XPathExec.Exec(t tree.Node, opts ...FuncOpts) (tree.Result, error) func XPathExec.ExecBool(t tree.Node, opts ...FuncOpts) (bool, error) func XPathExec.ExecNode(t tree.Node, opts ...FuncOpts) (tree.NodeSet, error) func XPathExec.ExecNum(t tree.Node, opts ...FuncOpts) (float64, error) func XPathExec.MustExec(t tree.Node, opts ...FuncOpts) tree.Result
Opts defines namespace mappings and custom functions for XPath expressions. Funcs map[xml.Name]tree.Wrap NS map[string]string Vars map[string]tree.Result
XPathExec is the XPath executor, compiled from an XPath string Exec executes the XPath expression, xp, against the tree, t, with the namespace mappings, ns, and returns the result as a stringer. ExecBool is like Exec, except it will attempt to convert the result to its boolean value. ExecNode is like Exec, except it will attempt to return the result as a node-set. ExecNum is like Exec, except it will attempt to convert the result to its number value. MustExec is like Exec, but panics instead of returning an error. func MustParse(xp string) XPathExec func Parse(xp string) (XPathExec, error)
Package-Level Functions (total 5)
Marshal prints the result tree, r, in XML form to w.
MarshalStr is like Marhal, but returns a string.
MustParse is like Parse, but panics instead of returning an error.
Parse parses the XPath expression, xp, returning an XPath executor.
ParseExec parses the XPath string, xpstr, and runs Exec.